﻿<html>
<head>
    <title>HTML Document</title>

    <script type="text/javascript">
	        // Function Without Parameters
	        function JavaScriptFunctionWithoutParameters() 
	        {
	            outputID.innerHTML = "JavaScript function 'JavaScriptFunctionWithoutParameters' called.";
	        }
	        
	        // Function With Parameters
	        function JavaScriptFunctionWithParameters(message) 
	        {
	            outputID.innerHTML = "JavaScript function 'JavaScriptFunctionWithParameters' called: " + message + ".";
	        }
	        
    </script>

</head>
<body>

    <div id="outputID" style="color:Red; font-size:16">
        Hello from HTML document with script!
    </div>

    <!-- Button that calls JavaScript function 'JavaScriptFunctionWithParameters' -->
    <div>
        <button onclick="JavaScriptFunctionWithoutParameters();">
            Call JavaScript Function without Parameters
        </button>
    </div>
    
    <!-- Button that calls JavaScript function 'JavaScriptFunctionWithParameters' -->
    <div>
        <button onclick="JavaScriptFunctionWithParameters('Message from HTML Document');">
            Call JavaScript Function with Parameters
        </button>
    </div>
    
    <!-- Button that sets a property on a WPF object -->
    <div>
        <input type="text" name="titleInput" value="New Title" />
        <button onclick="window.external.Title=titleInput.value;">
            Set Title
        </button>
    </div>
    
    <!-- Button that sets a property on a WPF object -->
    <div>
        <input type="text" name="widthInput" value="500" />
        <button onclick="window.external.Width=widthInput.value;">
            Set Width
        </button>
    </div>
    
    <!-- Button that sets a property on a WPF object -->
    <div>
        <input type="text" name="heightInput" value="500" />
        <button onclick="window.external.Height=heightInput.value;">
            Set Height
        </button>
    </div>

    <!-- Button that calls a method on a WPF object -->
    <div>
        <button onclick="window.external.SetAllProperties(titleInput.value, widthInput.value, heightInput.value);">
            Set All Properties
        </button>
    </div>
        
</body>
</html>
